<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>后台管理模板</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../../css/global.css" media="all">
		<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
		<link rel="stylesheet" href="../../datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css">
		<style type="text/css">

			label {
				font-size: 18px;
			}
			img{
				margin-right: 10px
			}
			.complainwords {
				width: 15%;
				line-height: 27px;
				font-size: 16px;
			}
			.handle1 {
				margin-top: 10px;
			    /* padding-right: 40px; */
			    line-height: 60px;
			    float: left;
			    clear: both;
			    border-right: solid 1px;
			    margin-left: 5%;
			    width: 255px;
			    height: 120px;
			}
			.handle2{
				float: left;
			    margin-top: 10px;
			    margin-left: 45px;
			    line-height: 60px;
			    border-right: solid 1px;
			    width: 307px;
			    height: 120px;
			}
			span {
				margin-left: 10px;
				color: gray;
			}
			input[type="text"]{
				width: 159px;
				height: 30px;
				border-radius: 5px;
			}
			.freezzBeComplained {
				position: relative;
			    top: 40px;
			    float: left;
			    margin-left: 60px;
			}
			.hide1,.complainContent {
				display: none;
			}
			.hide2,.inputScore {
				display: none;
			}
			.contactBefore {
				position: relative;
			    top: 30px;
			    float: left;
			    margin-left: 60px;
			}
			.takeoffBefore {
				position: relative;
			    top: 30px;
			    float: left;
			    margin-left: 50px;
			}
		</style>
	</head>
	<body>
		<div class="layui-layout layui-layout-admin" style="border-bottom: solid 5px #1aa094;">
			<!--头部导航-->
			<div class="layui-header header header-demo" ></div>
			<!--左侧导航-->
			<div class="layui-side layui-bg-black" id="admin-side">
			</div>
			<!--右侧具体内容-->

			<div class="layui-body" style="bottom: 0;border-left: solid 2px #1AA094;padding:20px;margin-bottom: 30px" id="admin-body">
				<div class="title">投诉详情</div>
				<hr/>
				<div class="items">
					<div class="item">
						<label class="itemleft">发起人</label><label class="itemright" ><img src="../../images/6.jpg" id="headPortraitUrl"><label id="nickname">大灰狼</label></label>
					</div><hr>
					<div class="item">
						<label class="itemleft">被投诉人</label><label class="itemright" ><img src="../../images/xiaosong.jpg" id="beComplainUserHeadPortraitUrl"><label id="beComplainUserNickname">大灰狼</label></label>
					</div><hr>
					<div class="item">
						<label class="itemleft">投诉内容</label><label class="itemright complainwords" style="" id="complainContent">态度超恶劣的分行的文本段</label>
					</div><hr>
					<div class="item">
						<label class="itemleft">投诉时间</label><label class="itemright" id="complainTime">2017-7-4 19:03</label>
					</div><hr>
					<div>
						<label class="itemleft" style="float:left;margin-top: 10px;">处理</label>
						<div class="handle1">
							<div>
								<div class="layui-btn layui-btn-warm contactHide contactBefore" id="contact" onclick="Contact()">联络发起人</div><span class="hide1">电话联系发起人</span>
							</div>
							<div class="complainContent">发起人电话：<lable id="complainContent">13978212123</lable></div>
						</div>
						<div class="handle2">
							<div>
								<div class="layui-btn layui-btn-danger takeoffHide takeoffBefore" id="takeoff" onclick="Takeoff()">扣除被投诉人信用分</div><span class="hide2">并通知被投诉人</span>
							</div>
							<div class="inputScore"><input type="text" name="" placeholder="输入分数" style="width: 130px">&nbsp;&nbsp;&nbsp;<label class="layui-btn" style="margin-left:25px">提交</label></div>
						</div>
<<<<<<< HEAD
					<div  style="text-align: center;clear:both;position: relative;top: 40px;">
						<span class="layui-btn layui-btn-danger" style="margin:auto;">冻结被投诉人账号</span>
					</div>

=======
							<div class="layui-btn layui-btn-danger freezzBeComplained">冻结被投诉人账号</div>
>>>>>>> d50226341fbe8ae132abe3c7ad1510b562307e5d
					</div>
				</div>
			</div>
			<!--底部导航-->
			<div class="layui-footer footer footer-demo" id="admin-footer"></div>
			<!--JS模块-->
			<script type="text/javascript" src="../../layui/layui.js"></script>
			<script src="../../js/jquery-1.12.3.min.js"></script>
			<script src="../../js/index.js"></script>
			<script src="../../layui/layui.js"></script>
			<script>
			var data = {
				"code": 200,
				"complain": {
					"id": 12345,
					"beComplainUserId": 75198,
					"nickname": "小白兔",
					"username": "15967179986",
					"headPortraitUrl": "../../images/fems.jpg",
					"complainUserId": 76533,
					"beComplainUserNickname": "大灰狼",
					"beComplainUserHeadPortraitUrl": "../../images/find_1.png",
					"complainTime": "2017-8-8 11:30",//ture是啥玩意
					"complainContent": "没有送到我家楼下",
					"complainState": 26381//0未完成 1 完成 
				}
			}
			$(function() {
				C1 = window.location.href.split("?")[1];
				complainid = C1.split("=")[1];
				/*$.ajax({
                     type: "get",
                     url: "/AdminController/complain/"+complainid,
                     data: {},
                     async: true,
                     dataType: "json",
                     contentType: "application/json",
                     success: function(data) {*/
					complaindetail(data)
                     /*},
                     Error: function() {
                         alert("服务器出错");
                     }
                 })*/
				function complaindetail(data) {
					$("#nickname").text(data.complain.nickname)
					$("#beComplainUserNickname").text(data.complain.beComplainUserNickname)
					$("#complainContent").text(data.complain.complainContent)
					$("#username").text(data.complain.username)
					$("#complainTime").text(data.complain.complainTime)
					$("#headPortraitUrl").attr('src', data.complain.headPortraitUrl);
					$("#beComplainUserHeadPortraitUrl").attr('src', data.complain.beComplainUserHeadPortraitUrl);
					$(".freezzBeComplained").attr('id', data.complain.beComplainUserId)
				}

			})

			function Contact() {
				if ($(".complainContent").css('display')=='none') {
					$(".complainContent").css('display', 'block');
					$(".hide1").css('display', 'inline');
					$(".contactHide").removeClass('contactBefore');
				} else {
					$(".hide1,.complainContent").css('display', 'none');
					$(".contactHide").addClass('contactBefore');
				}

			}
			function Takeoff() {
				if ($(".inputScore").css('display')=="none") {
					$(".inputScore").css('display', 'block');
					$(".hide2").css('display', 'inline');
					$(".takeoffHide").removeClass('takeoffBefore');
				} else {
					$(".hide2,.inputScore").css('display', 'none');
					$(".takeoffHide").addClass('takeoffBefore');
				}
			}

			$(".freezzBeComplained").on('click', function() {
				layui.use('layer', function() {
					var layer = layui.layer;
					layer.confirm('是否要冻结选中被投诉人账号？', {
						icon: 2,
						title: '提示'
					}, function(index) {
						/*$.ajax({
		                     type: "get",
		                     url: "/randomdelivery/AdminController/closeAccount/"+userid,
		                     data: {},
		                     async: true,
		                     dataType: "json",
		                     contentType: "application/json",
		                     success: function(data) {*/
		                     	if(data.code==200){
		                     		layer.msg("冻结成功")
		                     	}
						/*},
		                     Error: function() {
		                         alert("服务器出错");
		                     }
		                 })*/
					})
				})
			});


			</script>
		</div>
	</body>
</html>